package homework;

public class ThreadDemo {
    public static void main(String[] args) {
        //lambda方式
        Runnable r = new MyRunnable();
        /*Thread t = new Thread(()-> System.out.println("f"));*/
        Thread t = new Thread(()-> System.out.println("666"));
        t.start();
        //内部类方式
        Runnable r2 = new MyRunnable2();
        Thread t2 = new Thread(){
            public void run(){
                System.out.println(999);
            }
        };
        t2.start();
    }

}
class MyRunnable implements Runnable{
    public void run(){}
}
class MyRunnable2 implements Runnable{
    public void run(){}
}